<style>
    table tr:hover {
        background-color: rgba(243, 240, 240, 0.808);
    }

    .box .bg tr:nth-child(1) {
        background: #999999;
    }

    .box .bg tr:nth-child(2n) {
        background: #eeeeee;
    }

    .rotate-a-90 {
        transform: rotate(90deg);
        -ms-transform: rotate(90deg);
        -moz-transform: rotate(90deg);
        -webkit-transform: rotate(90deg);
        -o-transform: rotate(90deg);
        transform: all .3s linear;
        -ms-transform: all .3s linear;
        -moz-transform: all .3s linear;
        -webkit-transform: all .3s linear;
        -o-transform: all .3s linear;
    }

    .rotate-a-0 {
        transform: rotate(-90deg);
        -ms-transform: rotate(-90deg);
        -moz-transform: rotate(-90deg);
        -webkit-transform: rotate(-90deg);
        -o-transform: rotate(-90deg);
        transform: all .3s linear;
        -ms-transform: all .3s linear;
        -moz-transform: all .3s linear;
        -webkit-transform: all .3s linear;
        -o-transform: all .3s linear;
    }
</style>
<script>
    var _dc_render_target_;
    var _dc_table_cb_;
    var __dc_render_data_;
    var _dc_table_id_;
    var _dc_table_count_;
    var isFirst = true;
    var _dc_table_limit;

    // 深复制对象
    function _deep_clone_(obj) {
        if (!(typeof obj === 'object' && obj)) {
            return null;
        }
        var rtn_obj = Array.isArray(obj) ? [] : {};
        for (var key in obj) {
            if (obj.hasOwnProperty(key)) {
                if (typeof obj[key] === 'obj' && obj[key]) {
                    rtn_obj[key] = deepClone(obj[key]);
                } else {
                    rtn_obj[key] = obj[key];
                }
            }
        }
        return rtn_obj;
    }

    // 获取指定时间离当前时间的值
    function _get_diff_date_(dateTimeStamp) {
        var minute = 1000 * 60;
        var hour = minute * 60;
        var day = hour * 24;
        var halfamonth = day * 15;
        var month = day * 30;
        var now = new Date().getTime();
        dateTimeStamp = new Date(dateTimeStamp.replace(/-/g, "/"));
        var diffValue = now - dateTimeStamp;
        if (diffValue < 0) {
            return;
        }

        var monthC = diffValue / month;
        var weekC = diffValue / (7 * day);
        var dayC = diffValue / day;
        var hourC = diffValue / hour;
        var minC = diffValue / minute;
        if (monthC >= 1) {
            result = "" + parseInt(monthC) + "月前";
        } else if (weekC >= 1) {
            result = "" + parseInt(weekC) + "周前";
        } else if (dayC >= 1) {
            result = "" + parseInt(dayC) + "天前";
        } else if (hourC >= 1) {
            result = "" + parseInt(hourC) + "小时前";
        } else if (minC >= 1) {
            result = "" + parseInt(minC) + "分钟前";
        } else
            result = "刚刚";
        return result;
    }

    // 将相应位置字符串替换
    function _mask_text_(text, from, count, char) {
        _text_ = "";
        for (let index = 0; index < count; index++) {
            _text_ += char;
        }
        return text.substr(0, from) + _text_ + text.substr(from + count, text.length - from - count);
    }

    // 将文件大小格式化
    function _get_file_formated_size_(value, bit) {
        if (null == value || value == '') {
            return "0B";
        }
        var unitArr = new Array("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB");
        var index = 0;
        var srcsize = parseFloat(value);
        index = Math.floor(Math.log(srcsize) / Math.log(1024));
        var size = srcsize / Math.pow(1024, index);
        size = size.toFixed(bit); //保留的小数位数
        return size + unitArr[index];
    }

    function insertElement(element, id, class_name = "", style = "") {
        _id = document.getElementById(id);
        if (!_id) {
            _element = document.createElement(element);
            _element.id = id;
            _element.name = id;
            _element.style.cssText = style;
            _element.className = class_name ? class_name : "";
            document.body.appendChild(_element);
        }
    }

    // 使用字典数据显示表格
    function render_table(data, click, cb) {
        // 保存点击行的回调
        data.click_cb = click;
        data.loaded_cb = cb;
        // 保存div的宽度
        data.table_width = parseInt($("#" + data.id).css("width"));
        // 使用变量保存配置的数据
        _dc_render_data_ = data;
        // 根据id保存配置的数据
        window[`_dc_table_data_${data.id}_`] = data;

        // 插入搜索栏
        if (_dc_render_data_.page_config && _dc_render_data_.page_config.require && _dc_render_data_.page_config.require
            .search_keyword_param) {

            insertElement(
                "div", "_dc_table_" + _dc_render_data_.id + "_search_bar_", "", "width:100%");
            $('#' + data.id).append($(
                "#_dc_table_" + _dc_render_data_.id + "_body_"));
            $('#' + data.id).append($("#_dc_table_" +
                _dc_render_data_.id + "_search_bar_"));

            tempStr = `
<div style="display:-webkit-inline-box;margin-bottom:10px;">
    <div
        style="width:150px;height:32px;display:-webkit-inline-box;border-width: 1px;border-style: solid;border-color: lightgray;">
        <input style="width: 120px;height:26px;border-style: none;margin-top: 2px;" id="_dc_table_search_input_${data.id}"
            type="text">
        <img id="_dc_table_clear_search_${data.id}" style="display: none;"
            src="https://res.dcdev.net/dcdev/v1.0.6/assets/images/close.svg" alt=""
            width="30px">
    </div>
    <img id="_dc_table_exec_search_${data.id}"
        src="https://res.dcdev.net/dcdev/v1.0.6/assets/images/search.svg" alt=""
        width="30px">
</div>  
`
            // 插入搜索框
            $(`#_dc_table_${_dc_render_data_.id}_search_bar_`).html(tempStr);

            $(`#_dc_table_search_input_${data.id}`).keyup(function (event) {
                var e = (event) ? event : window.event;
                if (e.keyCode == 13) {
                    get_page_data(data.id, 1)

                } else if (e.keyCode == 27) {
                    $(this).val("")
                } else {
                    value = $(this).val();
                    $(`#_dc_table_clear_search_${data.id}`).css("display", value ? "block" : "none");
                }
            });

            // 点击查询按钮
            $(`#_dc_table_exec_search_${data.id}`).click(function () {
                get_page_data(data.id, 1)

            })

            // 点击清除
            $(`#_dc_table_clear_search_${data.id}`).click(function () {
                $(this.parentElement.firstElementChild).val("");
                $(this).css("display", "none");
                $(this.parentElement.firstElementChild).focus();
            })

            // get_page_data(data.id, 1)

        }

        // 插入表格
        insertElement("div", "_dc_table_" + _dc_render_data_.id + "_body_", "", "width:100%");

        // 插入分页栏
        if (_dc_render_data_.page_config) {

            insertElement(
                "div", "_dc_table_" + _dc_render_data_.id + "_bar_", "", "width:100%");
            $('#' + data.id).append($(
                "#_dc_table_" + _dc_render_data_.id + "_body_"));
            $('#' + data.id).append($("#_dc_table_" +
                _dc_render_data_.id + "_bar_"));

            _dc_inputor_id_ = `_dc_current_page_inputor_${_dc_render_data_.id}`;
            tempStr = `
        <div select-id="${data.id}" style="position:absolute;"></div>
<div style="display:-webkit-inline-box;margin-top:10px;">
    <a onclick="_dc_click_page_('${data.id}','pre-step-page')"><img id="pre-step${data.id}" width="32px" src="https://res.dcdev.net/dcdev/v1.0.6/assets/images/pre-step.svg"></a>
    <a onclick="_dc_click_page_('${data.id}','pre-page')"><img id="pre${data.id}" width="32px" src="https://res.dcdev.net/dcdev/v1.0.6/assets/images/pre.svg"></a>
    <input style="width: 70px;height:32px;" type="number" id="${_dc_inputor_id_}" value="">
    <a onclick="_dc_click_page_('${data.id}','next-page')"><img id="next${data.id}" class="dcdev-rotate-180" style="margin-top:-2px;" width="32px" src="https://res.dcdev.net/dcdev/v1.0.6/assets/images/pre.svg"></a>
    <a onclick="_dc_click_page_('${data.id}','next-step-page')"><img id="next-step${data.id}" class="dcdev-rotate-180" style="margin-top:-2px;" width="32px" src="https://res.dcdev.net/dcdev/v1.0.6/assets/images/pre-step.svg"></a>
    
    <div id="_dc_select_page_count_div_${data.id}" style="cursor:default;display:-webkit-inline-box;border-color: lightgray;border-width: 1px;border-style: solid;height: 32px;margin-left: 10px;">
        <div id="select_page_count${data.id}" style="margin-left:5px;margin-top:5px;margin-right:5px;height: 32px;">${data.page_config.limit}</div>
        <img id="_dc_select_page_count_arrow_${data.id}" width="32px" class="rotate-a-0" src="https://res.dcdev.net/dcdev/v1.0.6/assets/images/pre.svg">
    </div>
    <br>
</div>
<div style="display: inline-block;font-size:12px;color:gray;" id="_dc_detail_${data.id}"></div>
`
            // 插入分页选择框
            $("#" + "_dc_table_" + _dc_render_data_.id + "_bar_").html(tempStr);

            limit = localStorage[encodeURIComponent(location.href) + "_" + data.id + "_limit"];
            // 已保存之前的页数
            if (limit) {
                _dc_render_data_.page_config.require.data[_dc_render_data_.page_config.require.page_count_param] =
                    limit;
                $(`#select_page_count${data.id}`).html(limit);
            }
            // 没有保存则使用默认
            else {}

            $(`#_dc_select_page_count_div_${data.id}`).click(function () {
                var selectcountdl = "";
                for (var i = 0; i < data.page_config.limits.length; i++) {
                    selectcountdl += `<dd onclick="jumpToPage('${data.id}','${data.page_config.limits[i]}')">
                                <a href='javascript:;'>${data.page_config.limits[i]}</a></dd>`
                }
                // 关闭菜单
                if ($(`#_dc_select_page_count_arrow_${data.id}`).hasClass("rotate-a-90")) {
                    $(`#_dc_select_page_count_arrow_${data.id}`).removeClass("rotate-a-90")
                        .addClass("rotate-a-0");
                    $('div[select-count="' + data.id + '"]').remove()
                }
                // 展开菜单
                else {
                    $(`#_dc_select_page_count_arrow_${data.id}`).removeClass("rotate-a-0")
                        .addClass("rotate-a-90");
                    if (browser_info.is_mobile) {
                        var width = browser_info.width - 20 * 0.524 * 0.125
                        $('div[select-id="' + data.id + '"]').append(
                            "<div class='select_page_count' select-count='" +
                            data.id +
                            "'></div>");
                        $('div[select-count="' + data.id + '"]').append(`
                            <dl style='top: -115px;margin-left: 220px;min-width: 61px;text-align: center;' class='layui-nav-child layui-anim layui-anim-upbit layui-show'>
                                ${selectcountdl}
                            </dl>
                            `);
                    } else {
                        var width = browser_info.width * 0.524 * 0.125
                        $('div[select-id="' + data.id + '"]').append(
                            "<div class='select_page_count' select-count='" +
                            data.id +
                            "'></div>");
                        $('div[select-count="' + data.id + '"]').append(`
                            <dl style="top: -115px;min-width: 61px;text-align: center;left:240px;margin-left: -20px;" class="layui-nav-child layui-anim layui-anim-upbit layui-show">
                                ${selectcountdl}
                            </dl>
                            `);
                    }
                }
            })

            function handleGetPageInput(data, _this) {
                page_number_to_go = 0;
                // 为空时设置为=1
                if ($(_this).val() == "") {
                    $(_this).val(1);
                    page_number_to_go = 1;
                } else {
                    _value = parseInt($(_this).val());
                    if (_value > data.page_config.page_amount) {
                        $(_this).val(data.page_config.page_amount);
                        page_number_to_go = data.page_config.page_amount;
                        // 忽略
                    } else if (_value < 1) {
                        $(_this).val(1);
                        page_number_to_go = 1;
                        // 忽略
                    } else {
                        page_number_to_go = $(_this).val();
                    }
                }

                // $(_this).blur();
                get_page_data(data.id, page_number_to_go);


            }
            $('#' + _dc_inputor_id_).blur(function () {
                handleGetPageInput(data, this);
            });

            // 添加输入页码事件
            $('#' + _dc_inputor_id_).keyup(function (event) {
                var e = (event) ? event : window.event;
                if (e.keyCode == 13) {
                    handleGetPageInput(data, this);
                }
            });
            get_page_data(data.id, "")

        }
    }

    //选择显示页数
    function jumpToPage(id, limit) {
        $("#_dc_current_page_inputor_" + id).val('1')
        $(`#_dc_select_page_count_arrow_${id}`).removeClass("rotate-a-90")
            .addClass("rotate-a-0");
        $('div[select-count="' + id + '"]').remove();
        $("#select_page_count" + id).html(limit)
        _dc_render_data_ = window[`_dc_table_data_${id}_`];
        _dc_render_data_.page_config.require.data[_dc_render_data_.page_config.require.page_count_param] = limit;
        // 保存当前组件的页数
        localStorage[encodeURIComponent(location.href) + "_" + id + "_limit"] = limit;
        get_page_data(id, '');
    }

    // 将字典渲染成表格
    function render_table_by_data(id, _dc_render_data_) {
        _td_key_ = "";

        _table_html_ = "";
        _th_html_ = "";
        _tr_html_ = "";
        _td_html_ = "";
        _td_width_ = 0;

        // 表头部分
        if (_dc_render_data_.th_config) {
            // th的样式
            _th_config_ = _dc_render_data_.th_config;
            for (let index = 0; index < _th_config_.length; index++) {
                const element = _th_config_[index];
                _th_html_ +=
                    `<th colspan="${element.th_colspan?element.th_colspan:1}" class="${element.th_class}" style="${element.th_style}">` +
                    element.th_html.replace(`{th_title}`, element.th_title) + `</th>`
            }
        }

        // tr的样式
        for (let index = 0; index < _dc_render_data_.table_data.length; index++) {
            const row_data = _deep_clone_(_dc_render_data_.table_data[index]);
            // 先处理字段函数
            if (_dc_render_data_.td_config.td_function) {
                _dc_render_data_.td_config.td_function.forEach(element => {
                    switch (element.type) {
                        // 字段类型为日期型
                        case "format_datetime":
                            if (element.format == "to-now") {
                                // 获得到当前时间有多长
                                row_data[element.field] = _get_diff_date_(row_data[element.field])
                            }
                            break;
                        case "mask_text":
                            row_data[element.field] = _mask_text_(row_data[element.field], element.from, element
                                .to, element.char);
                            break;
                        case "format_filesize":
                            row_data[element.field] = _get_file_formated_size_(parseInt(row_data[element
                                    .field]),
                                element.bit);
                            break;
                        case "format_search_keyword":
                            // 获得搜索关键字
                            keyword = $(`#_dc_table_search_input_${id}`).val();
                            if (keyword) {
                                // 以用户设置的颜色重点标出该关键字
                                row_data[element.field] = row_data[element.field].toString().replace(eval("/" +
                                        keyword + "/"),
                                    `<a style='color:${element.color?element.color:"red"}'>${keyword}</a>`);
                            }
                            break;
                    }
                });
            }

            // 获得td的html模板
            _temp_td_html = _dc_render_data_.td_config.td_html;

            // 为每个标签添加点击事件
            array = _temp_td_html.split("<");
            for (let tag_index = 0; tag_index < array.length; tag_index++) {
                const element = array[tag_index];
                if (element != "" && element.substring(0, 1) != "/") {
                    reg = />/;
                    attr_to_insert = ` onclick="_dc_click_td_(this,'${_dc_render_data_.id}','',${index})"`
                    array[tag_index] = element.replace(/>/, attr_to_insert + ">")
                }
            }
            _temp_td_html = array.join("<");

            // 将html模板中的#{}替换为字段名
            for (var key in row_data) {
                var item = row_data[key];
                // 得到待替换的字段名
                re = new RegExp(`#{${key}}`, "g");
                _temp_td_html = _temp_td_html.replace(re, row_data[key]);
            }

            _td_html_ += _temp_td_html;
            if(table_checkbox){
                _tr_html_ =
                `<tr data-row-index='${index}' class="${_dc_render_data_.tr_config.tr_class}" style="${_dc_render_data_.tr_config.tr_style}"><td><input type="checkbox" /></td><td style="${_dc_render_data_.td_config.td_style}">${_td_html_}</td></tr>`;
            }else{
                _tr_html_ =
                `<tr data-row-index='${index}' class="${_dc_render_data_.tr_config.tr_class}" style="${_dc_render_data_.tr_config.tr_style}"><td style="${_dc_render_data_.td_config.td_style}">${_td_html_}</td></tr>`;
            }
            _table_html_ += _tr_html_;
            _td_html_ = "";
            _tr_html_ = "";
        }
        // 拼接table
        _table_html_ =
            `<table id="_dc_render_table_${_dc_render_data_.id}_" class="${_dc_render_data_.table_config.table_class}" style="${_dc_render_data_.table_config.table_style};cursor:default;" id="_dc_table_${_dc_render_data_.id}_body_" width="100%">${_th_html_}${_table_html_}</table>`
        $("#_dc_table_" + _dc_render_data_.id + "_body_").html(_table_html_);
        if (_dc_render_data_.table_hover) {
            $("table tr:hover").css('background-color', _dc_render_data_.table_hover)
        }
    }

    // 点击分页切换图标
    function _dc_click_page_(id, func) {
        // 获取表格相关配置数据
        _dc_render_data_ = window[`_dc_table_data_${id}_`];
        var isJumpPage = false;
        // 获得当前页数
        page_number = _dc_render_data_.page_config.require.data[_dc_render_data_.page_config
            .require.page_number_param];
        switch (func) {
            case "pre-step-page":
                page_number = 1;
                if ($('#pre-step' + _dc_render_data_.id).css('opacity') == '0.3') {
                    isJumpPage = false;
                } else {
                    $('#next-step' + _dc_render_data_.id).css('opacity', '1')
                    $('#pre-step' + _dc_render_data_.id).css('opacity', '0.3')
                    $('#pre' + _dc_render_data_.id).css('opacity', '0.3')
                    $('#next' + _dc_render_data_.id).css('opacity', '1')
                    isJumpPage = true;
                }
                break;
            case "pre-page":
                $('#next' + _dc_render_data_.id).css('opacity', '1')
                $('#next-step' + _dc_render_data_.id).css('opacity', '1')
                if ((page_number - 1) < 1) {
                    page_number = 1;
                    if ($('#pre' + _dc_render_data_.id).css('opacity') == '0.3') {
                        isJumpPage = false;
                    }
                    $('#pre' + _dc_render_data_.id).css('opacity', '0.3')
                    // 忽略
                } else {
                    page_number--;
                    if (page_number == 1) {
                        $('#pre' + _dc_render_data_.id).css('opacity', '0.3')
                        $('#pre-step' + _dc_render_data_.id).css('opacity', '0.3')
                    }
                    isJumpPage = true;
                }
                break;
            case "next-page":
                // 如果下一页>最大页数
                $('#pre' + _dc_render_data_.id).css('opacity', '1')
                $('#pre-step' + _dc_render_data_.id).css('opacity', '1')
                if ((page_number + 1) > _dc_render_data_.page_config.page_amount) {
                    page_number = _dc_render_data_.page_config.page_amount;
                    if ($('#next' + _dc_render_data_.id).css('opacity') == '0.3') {
                        isJumpPage = false;
                    }
                    $('#next' + _dc_render_data_.id).css('opacity', '0.3')
                    // 忽略
                } else {
                    page_number++;
                    if (page_number == _dc_render_data_.page_config.page_amount) {
                        $('#next' + _dc_render_data_.id).css('opacity', '0.3')
                        $('#next-step' + _dc_render_data_.id).css('opacity', '0.3')
                    }
                    isJumpPage = true;
                }
                break;
            case "next-step-page":
                page_number = _dc_render_data_.page_config.page_amount;
                if ($('#next-step' + _dc_render_data_.id).css('opacity') == '0.3') {
                    isJumpPage = false;
                } else {
                    $('#pre-step' + _dc_render_data_.id).css('opacity', '1')
                    $('#pre' + _dc_render_data_.id).css('opacity', '1')
                    $('#next-step' + _dc_render_data_.id).css('opacity', '0.3')
                    $('#next' + _dc_render_data_.id).css('opacity', '0.3')
                    isJumpPage = true;
                }

                break;
            case "jump-page":
                page_number = _dc_render_data_.page_config.page_amount;
                //opacity: 0.3;
                break;
            default:
                break;
        }

        // 获得当前页数
        _dc_render_data_.page_config.require.data[_dc_render_data_.page_config
            .require.page_number_param] = page_number;

        $("#_dc_current_page_inputor_" + _dc_render_data_.id).val(page_number);
        if (isJumpPage) {
            get_page_data(_dc_render_data_.id, page_number);
        }
    }

    function get_page_data(id, page_number) {
        _dc_render_data_ = window[`_dc_table_data_${id}_`];
        // 设置待请求页数
        if (page_number == "") {
            page_number = 1
        } else {
            _dc_render_data_.page_config.require.data[_dc_render_data_.page_config.require.page_number_param] =
                page_number;
        }

        // 有关键字搜索条件
        if (_dc_render_data_.page_config.require.search_keyword_param) {
            // 将搜索参数写入请求data中
            _dc_render_data_.page_config.require.data[_dc_render_data_.page_config.require.search_keyword_param] =
                $(`#_dc_table_search_input_${id}`).val();
        }
        $.ajax({
            method: _dc_render_data_.page_config.require.method,
            dataType: _dc_render_data_.page_config.require.dataType,
            url: _dc_render_data_.page_config.require.url,
            data: {
                params: JSON.stringify(_dc_render_data_.page_config.require.data)
            },
            success: function (res) {
                if (res['res'] == 0) {
                    ui_class.show_error(res['tips'] ? res['tips'] : res['desc']);
                } else {
                    if (res.rows == 0) {
                        $("#_dc_table_" + _dc_render_data_.id + "_body_").html(`<div style="line-height: 66px;
    padding: 15px;
    text-align: center;
    color: #999;border: 1px solid #ddd;">
    <img style="width:50px" src="https://res.dcdev.net/dcdev/v1.0.6/assets/images/empty.svg"></div>`);
                        $("#" + "_dc_detail_" + _dc_render_data_.id).html(
                            `共 0 条 ，分 0 页`);
                        return;
                    }
                    _dc_render_data_ = window[`_dc_table_data_${id}_`];
                    // 获取表格数据
                    _dc_render_data_.table_data = res[_dc_render_data_.page_config.require
                        .require_data_param];

                    // 计算分页数量
                    record_amount = res[_dc_render_data_.page_config.require.data_count_param];
                    page_count = res[_dc_render_data_.page_config.require.page_count_param];
                    _dc_render_data_.page_config.page_amount = Math.ceil(parseInt(record_amount) / parseInt(
                        page_count));
                    var pagenumber = page_number ? page_number : "1";
                    // 写入当前页数 
                    $(`#_dc_current_page_inputor_${_dc_render_data_.id}`).val(pagenumber);
                    if (pagenumber == 1) {
                        $('#pre-step' + _dc_render_data_.id).css('opacity', '0.3')
                        $('#pre' + _dc_render_data_.id).css('opacity', '0.3')
                        $('#next' + _dc_render_data_.id).css('opacity', '1')
                        $('#next-step' + _dc_render_data_.id).css('opacity', '1')
                    }
                    if (_dc_render_data_.page_config.page_amount == 1) {
                        $('#pre-step' + _dc_render_data_.id).css('opacity', '0.3')
                        $('#pre' + _dc_render_data_.id).css('opacity', '0.3')
                        $('#next' + _dc_render_data_.id).css('opacity', '0.3')
                        $('#next-step' + _dc_render_data_.id).css('opacity', '0.3')
                    }
                    $("#" + "_dc_detail_" + _dc_render_data_.id).html(
                        `共 ${record_amount} 条 ，分 ${_dc_render_data_.page_config.page_amount} 页`);

                    // 渲染表格
                    render_table_by_data(_dc_render_data_.id, _dc_render_data_);
                    if (_dc_render_data_.loaded_cb) {
                        data = {
                            res: 1,
                            data: res.data,
                            table: `_dc_render_table_${_dc_render_data_.id}_`,
                        }
                        _dc_render_data_.loaded_cb(data);
                    }
                }
            }
        })
    }

    function _dc_click_td_(td, id, key, index) {
        // 表格数据
        table_data = window[`_dc_table_data_${id}_`].table_data;
        res = {
            td_node: td,
            td_selector: $(td),
            td_key: $(td).data("key"),
            td_value: table_data[index][$(td).data("key")],
            tr_index: index,
            tr_value: table_data[index]
        };

        // 获取点击行的回调
        click_cb = window[`_dc_table_data_${id}_`].click_cb;
        // 处理点击事件
        if (click_cb) {
            click_cb(res);
        }
    }
</script>